#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#

class Mytype(type):
    def __init__(self, object_name, object_base, object_dic):
        # print(self)  # <class '__main__.Foo'>
        # print(object_name)  # Foo
        # print(object_base)  # (<class 'object'>,)
        # print(object_dic)  # {'__module__': '__main__', ......>}
        # 如果有其它的数据，也需要继承下来
        if self.__dict__["__doc__"] is None or len(self.__dict__["__doc__"].strip()) == 0:
            raise ModuleNotFoundError("请添加注释")
        super(Mytype, self).__init__(object_name, object_base, object_dic)


class Foo(object, metaclass=Mytype):
    """  测试类    """
    name = "xiong"

    def __init__(self, name, age):
        self.name = name
        self.age = age

    @staticmethod
    def hello():
        print("hello world")

f=Foo("xiong", 100)
print(Foo.__dict__)
